Computing systems may be developed and organized in a number of ways. In some applications, different components of a system may be developed using different programming languages (e.g., C, C++, Perl, Python, Java, and Tcl) that are particularly suited to the functions performed by the respective system components. Efficient communication of data between processes written in different languages can be difficult because the languages may not provide a mechanism to communicate data with processes written in other languages.
As an illustrative example, in the field of circuit design, computer-aided design (CAD) tools provide a mechanism for users to quickly visualize, connect, and modify circuits using a graphical user interface (GUI). Using CAD tools, circuit designs can be assembled using a GUI, translated into a hardware description language (e.g., HDL and VHDL), and synthesized into hardware configuration data. Some CAD tools used for circuit design also provide a mechanism for simulation and debugging of circuit designs. CAD tools generally include a modeling process that maintains a data representation of the objects and connections of a circuit design and a separate GUI process that renders objects of the circuit design for display to a user. In some CAD tools, the GUI process is written in Java, which includes a number of libraries for graphical display of objects, while the modeling process is written in C++, which can perform computational tasks more efficiently. As indicated above, the use of multiple programming languages poses a challenge for communication of data between the modeling process and the GUI.
One approach for communication between processes of a CAD tool uses a foreign function interface (FFI) to communicate individual data transactions between a Java GUI process and a C++ modeling process. An FFI is a mechanism by which a process written in one programming language can invoke functions or make use of services of another process written in another programming language (e.g., functions provided by an operating system or software library). FFI code for communication of data transactions between the processes may be generated using the Simplified Wrapper and Interface Generator (SWIG). SWIG is a tool for generation of an FFI for communication between C/C++ functions and other languages (e.g., Java, Python, Perl, or Tcl). Although use of FFIs in this approach allows a Java GUI process and C++ modeling process to exchange individual data transactions, a very large number of transactions are initiated in the normal operation of the CAD tool.